﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DAL;
using System.Data;

namespace BLL
{
   public class AbanINStockBLL
    {
       private AbanINStockDAL reDal = new AbanINStockDAL();
      
       /// <summary>
       /// GetAbanINStockList
      /// </summary>
      /// <returns></returns>
       public DataSet GetAbanINStockList()
       {
       return reDal.GetAbanINStockList();
       }

       /// <summary>
       /// 报废入库单细表
       /// </summary>
       /// <param name="FBillNo"></param>
       /// <param name="FEntryID"></param>
       /// <returns></returns>
       public DataSet   GetAbanINStockDetail(string FBillNo,string FEntryID)
           {
           return reDal.GetAbanINStockDetail( FBillNo, FEntryID);
    
       }

       //获取入库条码
       public bool GetAbanINCode(string PkgsBarCode, string FBillNo, out string PlaceBarCode, out string PlaceName, out string FInterID, out string dc)
        {
            PlaceBarCode = ""; PlaceName = "";
            return reDal.GetAbanINCode(PkgsBarCode, FBillNo, out  PlaceBarCode, out  PlaceName, out FInterID, out dc);
             }
       /// <summary>
       /// 更新明细库位信息
       /// </summary>
       /// <param name="FInterID"></param>
       /// <param name="PkgsBarCode"></param>
       /// <param name="PlaceBarCode"></param>
       /// <param name="PkgsIsRegular"></param>
       /// <returns></returns>
       public bool UpdateAbanINStock(string FInterID, string PkgsBarCode, string PlaceBarCode, string dc,string Fry)
       {
           return reDal.UpdateAbanINStock(FInterID, PkgsBarCode, PlaceBarCode, dc, Fry);
       }

       /// <summary>
       /// 完成报废入库
       /// </summary>
       /// <param name="FBillNo"></param>
       /// <param name="FEntryID"></param>
       /// <returns></returns>
     public bool  FinishAbanINStock(string FBillNo, String FEntryID, out string txt)
       {
           bool lb_return = false;
           txt ="";
           bool result1 = reDal.IsFinishEnter(FBillNo,FEntryID, out  txt);
           if (result1 == true)
           {
               lb_return = reDal.FinishAbanINStockEnter(FBillNo, FEntryID);
           }
           else
           {
               txt = "完成报废入库失败"+txt;
           }
           return lb_return;
       }
    }
}
